package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {
    /**根据OpenId查询*/
    @Select("select * from user where openid = #{openid}")
    User selectByOpenId(String openid);



    /**添加新用户*/
    @Insert("insert into user (openid,create_time) values (#{openid},#{createTime})")
    @Options(useGeneratedKeys = true,keyProperty = "id",keyColumn = "id")
    void insertUser(User user);

    /**当日新增数量*/
    Integer countByMap(Map map);
}
